package DB;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JDBC {
    private static String url = "jdbc:mysql://localhost:3306/testlib?useSSL=false&serverTimezone=UTC";
    private static String userName = "root";
    private static String passWord = "123456";

        public static Connection getConnection () throws SQLException {
            return DriverManager.getConnection(url, userName, passWord);
        }

        public static void close (Connection conn){
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
}
